#pragma once
#include <QDialog>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QShowEvent>
#include <QCloseEvent>
#include <QStackedWidget>
#include "Keyboard/KeyboardManager.h"
#include "board_utils.h"

using namespace AeaQt;

class CabinetHalfwayDialog : public QDialog
{
    Q_OBJECT
public:
    explicit CabinetHalfwayDialog(QWidget *parent = nullptr);
    virtual ~CabinetHalfwayDialog();

    QLineEdit *phoneEdit;
    QLineEdit *pwdEdit;
    QPushButton *backBtn;
    QPushButton *okBtn;
    NumberKeyboard *keyboard;

protected:
    void showEvent(QShowEvent *event) override;
    void closeEvent(QCloseEvent *event) override;

private slots:
    void onOkBtnClicked();

private:
    void setupUI();
    void setupPhonePasswordWidget();
    void setupTipWidget();
    void setupConnections();

    QVBoxLayout *mainLayout;
    QWidget *phonePasswordWidget;
    QWidget *tipWidget;
    QPushButton *phonePwdBtn;
    QPushButton *braceletPalmBtn;
    QStackedWidget *stackedWidget;
};